package zuochengyun;

public class bitOperation {
    public static void print(int n) {
        for (int i = 31; i >= 0; i--) {
            System.out.print((n & (1 << i)) == 0 ? "0" : "1");
        }
    }

    public static void main(String[] args) {
        int a = -5;
        int b = ~a;
        print(a);
        System.out.println(a);
        print(b);
        System.out.println(b);
        print(-5);
        System.out.println();
        print(5);
    }
}
